module WindSpirit
{
    export class System
    {
        static curMusic: egret.Sound = null;
        static isInit = false;
        static init(id)
        {
            if(!this.isInit)
            {
                WindSpirit.Config.gameId = window['gameid'] || id;
                //更新本地存储key
                WindSpirit.GameData.storeKey = WindSpirit.Config.gameId + "-gameData";
                if(egret.localStorage.getItem(WindSpirit.GameData.storeKey))
                {
                    WindSpirit.GameData.initData();
                }
                else
                {
                    WindSpirit.GameData.saveData();
                }
                WindSpirit.Util.printInfo();
                if(WindSpirit.Config.DEBUG)
                {
                    WindSpirit.Util.showFPS();
                }
                WindSpirit.Util.onResize();
                WindSpirit.Util.onStageStateChange();
                this.isInit = true;
            }
        }
    }
}